<script setup lang="ts">

import Category from "@/vueTest/c/09_slot_默认插槽/Category.vue";
import {reactive, ref} from "vue";

let games = reactive([{id: 'fadfda01', name: '英雄联盟'}, {id: 'fasdfa02', name : '王者荣耀'}, {id : 'fdsafads03', name: '逆水寒'}])
let imgUrl = ref('https://z1.ax1x.com/2023/11/19/piNxLo4.jpg')
let videoUrl = ref('http://clips.vorwaerts-gmbh.de/big_duck_bunny.mp4')
</script>

<template>
  <div class="father">
    <h3>父组件</h3>
    <div class="content">
      <Category>
        <template v-slot:s2>
          <ul>
            <li v-for="g in games" :key="g.id">{{g.name}}</li>
          </ul>
        </template>
        <template v-slot:s1>
          <h2>
            热门游戏列表
          </h2>
        </template>
      </Category>
      <Category >
        <template v-slot:s2>
          <img :src="imgUrl" alt="">
        </template>
        <template>
          <h2>今日美食城市</h2>
        </template>
      </Category>
      <Category >
        <template v-slot:s2>
          <video :src="videoUrl"></video>
        </template>
        <template>
          <h2>今日影视推荐</h2>
        </template>
      </Category>
    </div>
  </div>
</template>

<style scoped>
.father {
  background-color: rgb(165, 164, 164);
  padding: 20px;
  border-radius: 10px;
}

.content {
  display: flex;
  justify-content: space-evenly;
}
img,video {
  width: 100%;
}
</style>